@echo off
setlocal

echo Testing Rate Limit...
echo.

:: 设置基础URL
set "BASE_URL=http://localhost:8080"

:: 测试用户信息接口 35次 (超过30次/分钟的限制)
for /l %%i in (1,1,35) do (
    echo Request %%i:
    curl -i -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0dXNlcjIxIiwiaWF0IjoxNzQzOTQwNjAyLCJleHAiOjE3NDQwMjcwMDJ9.mtsr_h1N5qx3x-jft03mOXJxJ7t7gvPnJSzU7C_UUNXeMRKGGRr3A5YhL3WaVP7bticv6FiQ_Bp_CiS2h8ppRQ" %BASE_URL%/api/users/1
    echo.
    echo.
    timeout /t 1 >nul
)

echo Test completed.
pause